package com.leetcode.LC;

public class LC62 {
    public int uniquePaths(int m, int n) {
        int[][] ints = new int[m][n];
        for (int i = 0; i < n; i++) {
            ints[0][i]=1;
        }
        for (int i = 0; i < m; i++) {
            ints[i][0]=1;
        }

        for (int i = 1; i < m; i++) {
            for (int j = 1; j < n; j++) {
                ints[i][j]=ints[i][j-1]+ints[i-1][j];
            }
        }
        return ints[m-1][n-1];
    }

    public static void main(String[] args) {
        System.out.println(new LC62().uniquePaths(3, 7));
    }
}
